import { defineStore } from 'pinia';


export const usePermissStore = defineStore('permiss', {
	state: () => {
		const keys = localStorage.getItem('ms_keys');
		return {
			key: keys ? JSON.parse(keys) : ['1'],
			defaultList: {
				admin: ['1', '2'],
				user: ['1']
			}
		};
	},
	actions: {
		handleSet(val) {
			this.key = val;
		},
		handleReset() {
			this.key = [];
		},

	}
});
